package org.bioversityinternational.mgbms.model.domain;

// Generated 13 oct. 2011 12:11:05 by Hibernate Tools 3.4.0.CR1

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * AccessionActivity generated by hbm2java
 */
@Entity
@Table(name = "Accession_Activity", schema = "dbo", catalog = "imgbms")
public class AccessionActivity implements java.io.Serializable {

	private AccessionActivityId id;
	private Activity activity;
	private Accession accession;

	public AccessionActivity() {
	}

	public AccessionActivity(AccessionActivityId id, Activity activity,
			Accession accession) {
		this.id = id;
		this.activity = activity;
		this.accession = accession;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "accessionId", column = @Column(name = "accessionId", nullable = false)),
			@AttributeOverride(name = "activityId", column = @Column(name = "activityId", nullable = false)) })
	public AccessionActivityId getId() {
		return this.id;
	}

	public void setId(AccessionActivityId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "activityId", nullable = false, insertable = false, updatable = false)
	public Activity getActivity() {
		return this.activity;
	}

	public void setActivity(Activity activity) {
		this.activity = activity;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "accessionId", nullable = false, insertable = false, updatable = false)
	public Accession getAccession() {
		return this.accession;
	}

	public void setAccession(Accession accession) {
		this.accession = accession;
	}

}
